package partner_api

import (
	"gitee.com/theegg/go-brick/app/model/partner/partner_admin/partner_admin_users"
	"gitee.com/theegg/go-brick/app/service/app"
	"github.com/gin-gonic/gin"
)

// @title GetLoginPartnerAdminUser
// @description 获取当前登陆用户
func GetLoginPartnerAdminUser(c *gin.Context) *partner_admin_users.PartnerAdminUsers {
	user, ok := c.Get("c_partner_admin_user")

	if !ok {
		app.NewResponse(c).ErrorReturn(app.UnauthorizedTokenError)
		c.Abort()
		return nil
	}

	return user.(*partner_admin_users.PartnerAdminUsers)
}
